import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
      redirect:'/home/test',
      children:[
        {
          path: 'test',
          name: '考试',
          component: () => import('../views/home/TestView.vue'),
          meta: {
            name: '考试',
          }
        },
        {
          path: 'exam',
          name: '阅卷',
          component: () => import('../views/home/ExamVIew.vue'),
          meta: {
            name: '阅卷',
          }
        },
        {
          path: 'subjects',
          name: '试卷',
          component: () => import('../views/home/SubjectsView.vue'),
          meta: {
            name: '试卷',
          }
        },
        {
          path: 'databaselist',
          name: '题库',
          component: () => import('../views/home/DatabaselistView.vue'),
          meta: {
            name: '题库',
          },
        },
        {
          path: 'department',
          name: '部门',
          component: () => import('../views/home/DepartmentView.vue'),
          meta: {
            name: '部门',
          },
        },
        {
          path: 'teacher',
          name: '师资',
          component: () => import('../views/home/TeacherView.vue'),
          meta: {
            name: '师资',
          },
        },
        {
          path: 'classes',
          name: '班级',
          component: () => import('../views/home/ClassesView.vue'),
          meta: {
            name: '班级',
          },
        },
        {
          path: 'student',
          name: '学员',
          component: () => import('../views/home/StudentView.vue'),
          meta: {
            name: '学员',
          },
        },
        {
          path: 'role',
          name: '角色',
          component: () => import('../views/home/RoleView.vue'),
          meta: {
            name: '角色',
          },
        }
      ]
    }
  ]
})

export default router
